<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
		"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Логин</title>
	<link rel="stylesheet" type="text/css" href="/Bike/ext/resources/css/ext-all.css" />
	<script type="text/javascript" src="/Bike/js/en.js"></script>
	<script type="text/javascript" src="/Bike/ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="/Bike/ext/ext-all.js"></script>
	<script type="text/javascript">
		Ext.onReady(function(){
			Ext.QuickTips.init();
			var login = new Ext.FormPanel({
				labelWidth:80,
				url:'/Bike/controllers/login.php',
				frame:true,
				defaultType:'textfield',
				monitorValid:true,
				items:[{
					fieldLabel: LOGIN_TITLE_LOGIN,
					width: 375,
					name:'login',
					allowBlank:false
				},{
					fieldLabel: LOGIN_TITLE_PASSWORD,
					name:'password',
					width: 375,
					inputType:'password',
					allowBlank: true
				},{
					fieldLabel:'',
					name:'adminlogin',
					value:'1',
					inputType:'hidden'
				}, new Ext.Panel({id: 'msg', height: 16, html: '<center style="color: gray"></center>'})]
			});
			function loginClick(){
				Ext.getCmp('msg').body.dom.innerHTML='<span style="color: gray; padding-left: 18px; padding-bottom: 1px; background-image: url(/Bike/images/default/grid/loading.gif); background-repeat: no-repeat;">' + LOGIN_AUTH_IN_PROGRESS + '</span>';
				login.getForm().submit({
					method:'POST',
					waitTitle: LOGIN_WAIT_MESSAGE,
					success:function(){
						window.location.href=window.location.pathname;
					},
					failure:function(form, action){
						if(action.failureType == 'server'){
							obj = Ext.util.JSON.decode(action.response.responseText);
							Ext.getCmp('msg').body.dom.innerHTML='<span style="color: red">' + obj.errors.reason + '</span>';
							Ext.getCmp('msg').body.slideIn();
						}else{
							if(undefined == action.response){
								Ext.getCmp('msg').body.dom.innerHTML='<span style="color: red">' + LOGIN_FILL_FORM + '</span>';
							}else{
								 Ext.getCmp('msg').body.dom.innerHTML='<span style="color: red">' + action.response.responseText + '</span>';
							}
							Ext.getCmp('msg').body.slideIn();
						}
					}
				});
			}
			var win = new Ext.Window({
				layout:'fit',
				width:485,
				height:115,
				closable: false,
				resizable: false,
				draggable: false,
				plain: true,
				border: false,
				title: LOGIN_FORM_TITLE,
				items: [login]
			});
			win.show();
			var km = new Ext.KeyMap(win.getEl(), {
				key: 13,
				fn: function(){
					loginClick();
				},
				scope: login
			})
		});
		</script>

</head>
<body>

</body>
</html>